<div class="ibox">
<div class="ibox-content">
<form class="form-horizontal"  id="editForm" action="${cxt!}/platform/errorCode/update" method="POST" >

		   <input type="hidden" id="errorCodeid" name="errorCode.id" value="${errorCode.id!}" >
			
           <div class="form-group">
	             <label for="namebasic" class="col-md-2 control-label">${_res["systemManage.errorCode"]}<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="errorCode.errorcode" placeholder="${_res["systemManage.errorCode"]}" value="${errorCode.errorcode!}" required aria-required="true" readonly="readonly">
	             </div>
	             
                <label class="col-sm-2 control-label">${_res["systemManage.returnType"]}<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <#dict type="select" id="returnType" class="form-control" name="errorCode.returntype"  dictCode="RETURN_TYPE" required="true" value="${errorCode.returntype!}" />
                </div>		             
           </div>
           <div class="hr-line-dashed"></div>
 
           <div class="form-group">
	             <label for="namebasic" class="col-md-2 control-label">${_res["systemManage.errorMessageCn"]}<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="errorCode.message" placeholder="${_res["systemManage.errorMessageCn"]}"  value="${errorCode.message!}"  required aria-required="true">
	             </div>
	             
	             <label for="namebasic" class="col-md-2 control-label">${_res["systemManage.errorMessageEn"]}<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="errorCode.messageen" placeholder="${_res["systemManage.errorMessageEn"]}"  value="${errorCode.messageen!}"  required aria-required="true">
	             </div>	             
           </div>
           <div class="hr-line-dashed"></div>
            
           <div id="url-parameter"> 
	           <div class="form-group">
		             <label for="namebasic" class="col-md-2 control-label">${_res["systemManage.filedName"]}<span class="fontColorRed">&nbsp;*</span></label>
		             <div class="col-md-3">
		              	<input type="text" class="form-control" id="filedName" name="errorCode.filedname" placeholder="${_res["systemManage.filedName"]}"  value="${errorCode.filedName!}"  required aria-required="true">
		             </div>     
	     
		             <label for="namebasic" class="col-md-2 control-label">${_res["systemManage.errorUrl"]}<span class="fontColorRed">&nbsp;*</span></label>
		             <div class="col-md-3">
		              	<input type="text" class="form-control"  id="errorlUrl" name="errorCode.errorurl" placeholder="${_res["systemManage.errorUrl"]}"  value="${errorCode.errorurl!}"  required aria-required="true">
		             </div>	               
		             
	           </div>
	           <div class="hr-line-dashed"></div>     
	       </div>    
            
            <div class="form-group">
              <div class="col-md-10 col-md-offset-2">
                <button type="button" class="btn btn-warning" onClick="ajaxContent('/platform/errorCode/list');">${_res["system.return"]}</button>
                <button type="submit" class="btn btn-primary" >${_res["system.confirm"]}</button>
                <button type="button" class="btn btn-danger" onClick="ajaxContent('/platform/errorCode/list');">${_res["system.cancel"]}</button>
              </div>
            </div>
</form>
</div></div>
<#submit  formId="editForm"  divId="content" />
<#nav />
        
        
<script type="text/javascript">
	(function pageInit(){
		//进入编辑页面，根据默认returnType初始化控件
		initDefaultReturnType();
		
		//根据用户选择的执行方式，动态决定是否显示cron参数控件
		$("#returnType").change(function(){  
			var selVal=$(this).children('option:selected').val();//这就是selected的值
			if(selVal==1){  //returnType为html
				$("#url-parameter").css("display","block");
				$("#filedName").attr("required","true");
				$("#errorlUrl").attr("required","true");
				
				$("#filedName").attr("aria-required","true");
				$("#errorlUrl").attr("aria-required","true");
			}else{ //returnType为json
				$("#url-parameter").css("display","none");
				$("#filedName").removeAttr("required");
				$("#errorlUrl").removeAttr("required");
				
				$("#filedName").removeAttr("aria-required");
				$("#errorlUrl").removeAttr("aria-required");
			}
		});
	})();

	
	function initDefaultReturnType(){
		var selVal=$("#returnType").children('option:selected').val();
		if(selVal=='html'){  //returnType为html
			$("#url-parameter").css("display","block");
			$("#filedName").attr("required","true");
			$("#errorlUrl").attr("required","true");
			
			$("#filedName").attr("aria-required","true");
			$("#errorlUrl").attr("aria-required","true");
		}else{ //returnType为json
			$("#url-parameter").css("display","none");
			$("#filedName").removeAttr("required");
			$("#errorlUrl").removeAttr("required");
			
			$("#filedName").removeAttr("aria-required");
			$("#errorlUrl").removeAttr("aria-required");
		}
	}
</script>